﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using LFSRecord2.Model;

namespace LFSRecord2.View.Converters
{
    public class TimeOffsetToLeftMarginConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            int leftMargin = (int)((double)value * LfsRecordController.project.FPS);
            return new Thickness(leftMargin, 0, 0, 0);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return (double)((int)value / (double)LfsRecordController.project.FPS);
        }
    }
}
